<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="h">
    <div class="row">
        <div class="col-md-9">
            <a href="/"><img th:src="@{/static/images/logo.png}" id="img1" loading="lazy" style="height: 70px"
                             alt=""></a>
        </div>
        <div class="col-md-3">
            <p style="float: right;margin-top: 14%">
                <a href="/toLoginPage"><span class="badge badge-pill badge-success"
                                             th:if="${session.currentUser==null}">登录</span></a>
                <a href="/toPersonalHubsPage"><span class="badge badge-pill badge-success"
                                                    th:if="${session.currentUser!=null}">个人中心</span></a>
                <a href="/toContactPage"><span class="badge badge-pill badge-info" th:if="${session.currentUser!=null}">联系我们</span></a>
                <a href="javascript:logoutUser()"><span class="badge badge-pill badge-danger"
                                                        th:if="${session.currentUser!=null}">注销</span></a>
                <a href="/toMyShoppingCart"><span class="badge badge-pill badge-warning"
                                                        th:if="${session.currentUser!=null}">我的购物车</span></a>
            </p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <nav class="navbar navbar-expand-sm bg-primary navbar-dark">
                <ul class="navbar-nav">
                    <li class="nav-item active" th:if="${isHome!=null}">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item" th:if="${isHome==null}">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item active" th:if="${isSort!=null}">
                        <a class="nav-link" href="/toSortPage?goodsTypeId=1">分类</a>
                    </li>
                    <li class="nav-item" th:if="${isSort==null}">
                        <a class="nav-link" href="/toSortPage?goodsTypeId=1">分类</a>
                    </li>
                    <li class="nav-item active" th:if="${isWantToBuy!=null}">
                        <a class="nav-link" href="/toWantToBuyPage">用户求购</a>
                    </li>
                    <li class="nav-item" th:if="${isWantToBuy==null}">
                        <a class="nav-link" href="/toWantToBuyPage">用户求购</a>
                    </li>
                </ul>
                <div style="margin-left: 50%">
                    <form class="d-flex" action="/goods/search" method="post">
                        <input class="form-control me-2" type="text" id="name" name="name" required="required" th:value="${name}" placeholder="输入搜索关键词...">
                        <select class="form-control" id="goodsType" name="goodsType" th:value="${goodsType}" style="margin-left: 3px;width: 88px">
                            <option value="1" th:selected="${goodsType==1}">商品</option>
                            <option value="2" th:selected="${goodsType==2}">求购</option>
                        </select>
                        <button class="btn btn-primary bg-light" type="submit" style="margin-left: 3px"><i
                                class="fa fa-search" style="color:
#007bff"></i></button>
                    </form>
                </div>
            </nav>
        </div>
    </div>
</div>
</body>
</html>